package com.fhz.day004.presenter

import com.fhz.day004.contract.FoodContract
import com.fhz.day004.entity.Food
import io.reactivex.Observer
import io.reactivex.disposables.Disposable

/**
 * 时间:2021/10/15
 * @author msfeng
 * 简述: TODO
 */
class FoodPresenter(m:FoodContract.IFoodModel,v:FoodContract.IFoodView) : BasePresenter<FoodContract.IFoodModel,FoodContract.IFoodView>(m,v){

    fun getData(){
        mModel.getData(object : Observer<Food>{
            override fun onSubscribe(d: Disposable) {

            }

            override fun onNext(t: Food) {
                mView.initAdapter(t.data)
            }

            override fun onError(e: Throwable) {
            }

            override fun onComplete() {
            }
        })
    }
}